/**
 * Created with JetBrains WebStorm.
 * User: Joseph
 * Date: 29/04/12
 * Time: 1:33 AM
 * To change this template use File | Settings | File Templates.
 */
function ani_rolldice(piece, result) {
    console.log('rolled dice');
    $('#' + piece).attr({
        'src':images['dice' + result]
    })
        .effect("bounce", { times:3 }, 300);
}

function ani_flipcoin(piece, result) {
    console.log('flipped coin');
    var image;
    if (result > 1) {
        image = images['coin_head'];
    } else {
        image = images['coin_tail'];
    }

    $('#' + piece).attr({
        'src':image
    })
        .effect("bounce", { times:3 }, 300);
}

function ani_move(piece, x, y) {
    console.log('moved piece');
    $('#' + piece).css('left', x)
        .css('top', y);
}